package org.cboard.dao;

import org.apache.ibatis.annotations.Param;
import org.cboard.pojo.DashboardRole;
import org.cboard.pojo.DashboardRoleRes;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by yfyuan on 2016/12/6.
 */
@Repository
public interface RoleDao {
    int save(DashboardRole role);

    List<DashboardRole> getRoleList(String userId);

    List<DashboardRole> getRoleListAll();

    int update(DashboardRole role);

    List<DashboardRoleRes> getRoleResList();

    int saveRoleRes(List<DashboardRoleRes> list);

    int deleteRoleRes(String roleId);

    int deleteRoleResByResId(@Param("resId") Long resId, @Param("resType") String resType);

    /**
     * 手动添加对应的xml中的sql，原本是没有的 add by songgc
     * @param userId 用户id
     * @param resType 乐行
     * @return 列表
     */
    List<Long> getRoleResByResIds(@Param("userId") String userId, @Param("resType") String resType);

    DashboardRole getRole(String roleId);

    int deleteRole(String roleId);

    List<DashboardRoleRes> getUserRoleResList(@Param("userId") String userId, @Param("resType") String resType);
}
